﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Collections;
using AirLinq.Meta;
using System.Data;

namespace AirLinq.Dynamic {
	public class ReaderFactory<T>:ReaderFactory {
		private readonly IMaterializer<T> _materializer;
		public ReaderFactory(IMaterializer<T> materializer) {
			_materializer=materializer;
		}
		public override IEnumerator Create(IDbCommand command) {
			return CreateInstance(command);
		}
		public AirLinqDataReader<T> CreateInstance(IDbCommand command) {
			return new AirLinqDataReader<T>(command, _materializer);
		}
	}
}
